import Vue from 'vue';
import VueRouter from "vue-router";
import Main from "@/views/Main";
import Login from "@/views/Login";
import Home from "@/views/Home/Home";
import Search from "@/views/search/Search";
import Content from "@/views/Home/Content";
import ContentTwo from "@/views/Home/ContentTwo";
import ContentTr from "@/views/Home/ContentTr";
import ContentFour from "@/views/Home/ContentFour";
import MusicListDetail from "@/views/musicListDetail/MusicListDetail";
import SingerDetail from "@/views/singerDetail/SingerDetail";
import ContentFive from "@/views/Home/ContentFive";
import AlbumsDetail from "@/views/AlbumsDatail/AlbumsDetail";
import SearchSong from "@/views/search/searchChildren/SearchSong";
import SearchSinger from "@/views/search/searchChildren/SearchSinger";
import SearchAlbum from "@/views/search/searchChildren/SearchAlbum";
import SearchVideo from "@/views/search/searchChildren/SearchVideo";
import SearchMusicList from "@/views/search/searchChildren/SearchMusicList";
import Registered from "../views/Registered";


Vue.use(VueRouter);

const routes= [
        {path: '/', redirect: '/Home'},
        {
            path: '/', component: Main,
            children: [{
                path: '/Home', name:'Home', component: Home,
                redirect: '/Home/content',
                children: [
                    {path: 'content', component: Content,meta:{ title: '推荐'}},
                    {path: 'contentTwo', component: ContentTwo, meta:{ title: '排行榜'}},
                    {path: 'contentTr', component: ContentTr, meta:{ title: '歌曲'}},
                    {path: 'contentFour', component: ContentFour, meta:{ title: '歌手'}},
                    {path: 'contentFive', name:'contentFive', component: ContentFive}
                ]
            },
                {
                    path: '/search/:id', name: 'search', component: Search,
                    redirect: '/search/searchsong/:id',
                    children: [
                        { path: '/search/searchsong/:id', name: 'searchSong', component: SearchSong },
                        // { path: '/search/searchsinger/:id', name: 'searchSinger', component: SearchSinger},
                        // { path: '/search/searchalbum/:id', name: 'searchAlbum', component: SearchAlbum },
                        // { path: '/search/searchvideo/:id', name: 'searchVideo', component: SearchVideo },
                        // { path: '/search/searchmusiclist/:id', name: 'searchMusicList', component: SearchMusicList },
                    ]
                },
                { path: '/musiclistdetail/:id', name: 'musicListDetail', component: MusicListDetail},
                { path: '/singerdetail/:id', name: 'singerDetail', component: SingerDetail },
                { path: '/album/:id', name: 'album', component: AlbumsDetail },
            ]
        },

        {path: '/Login', component: Login},
        {path:'/Registered',component: Registered}
    ]

const router = new VueRouter({
    routes,
    mode: 'history',
})

export default router
